package com.bestcem.xm.award.controller.vo.award;

import com.bestcem.xm.award.controller.dto.AwardDTO;
import com.bestcem.xm.award.controller.dto.AwardListDTO;
import com.bestcem.xm.award.controller.dto.WinDataDTO;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 查询奖励VO
 * @author sh.pei <sh.pei@idiaoyan.com>
 * @version v3.0
 * @date 2021/8/18 19:27
 */
@NoArgsConstructor
@Getter
@Setter
@ToString
public class GetAwardVO implements Serializable {

    /**
     * 奖励传输DTO 单个奖励
     */
    private AwardDTO award;

    /**
     * 兑奖码数据 单个奖励
     */
    @JsonProperty(value = "win_data")
    private WinDataDTO winData;

    /**
     * 分页
     */
    private Integer page;

    /**
     * 每页大小
     */
    private Integer size;

    /**
     * 总数 列表查询奖励
     */
    private Integer total;

    /**
     * 奖励列表
     */
    private List<AwardListDTO> awards;

    /**
     * 增加奖励
     * @param awardListDTO
     */
    public void addAwardListDTO(AwardListDTO awardListDTO) {
        if (awards == null) {
            awards = new ArrayList<>();
        }
        awards.add(awardListDTO);
    }
}
